import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "",
      meta: { layout: false },
      hidden: true,
      children: [],
      redirect: "/login"
    },
    {
      path: "/login",
      name: "login",
      meta: { layout: false },
      hidden: true,
      children: [],
      component: () => import("../views/login/index.vue")
    },
    {
      path: "/first",
      name: "first",
      meta: { layout: true, title: "首页" },
      hidden: false,
      component: () => import("../views/first/index.vue"),
      children: []
    },
    {
      path: "/Order",
      name: "Order",
      meta: { layout: true, title: "订单管理" },
      component: { render: e => e("router-view") },
      children: [
        {
          path: "/order",
          name: "order",
          meta: { layout: true, title: "订单" },
          component: () => import("../views/Order/order/index.vue"),
          children: []
        },
        {
          path: "/refund",
          name: "refund",
          meta: { layout: true, title: "退款" },
          component: () => import("../views/Order/refund/index.vue"),
          children: []
        }
      ]
    },
    {
      path: "/user",
      name: "user",
      meta: { layout: true, title: "商品管理" },
      component: { render: e => e("router-view") },
      children: [
        {
          path: "/student",
          name: "student",
          meta: { layout: true, title: "商品详情" },
          children: [],
          component: () => import("../views/user/student/index.vue")
        }
      ]
    },
    // 添加商品页面
    {
      path: "/addStudents",
      name: "addStudents",
      meta: { layout: true, title: "添加商品" },
      hidden: true,
      component: () => import("../views/user/addStudents/index.vue"),
      children: []
    }
  ]
});
